<?php


namespace app\common\controller;


use app\common\service\delService;
use app\lib\exception\MysqlErrorException;

class Del
{
    public function delInID($arr,$model)
    {
        $service = new delService();
        $bool = $service->delAll($arr, $model);
    }

    public function delList($model, $from, $ids)
    {
        try{
            $model->where('name','=', $from)
                ->where('id', 'in', $ids)
                ->delete();
            return json(['code'=>200]);
        }catch (\Exception $e){
            throw new MysqlErrorException(['msg'=>$e->getMessage()]);
        }
    }
}